﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BaseUI
{
    public class BasePage : System.Web.UI.Page
    { 
        #region 页面加载
        /// <summary>页面加载前检查用户是否合法</summary>
        /// <param name="e">页面参数</param>
        /// <summary>
        protected void Page_Unload(object sender, EventArgs e)
        {
        }
        protected override void OnPreInit(EventArgs e)
        {
            base.OnPreInit(e);
            //base.StartProcessRequest();
            if (true)
            {
                //这里写 跳转到登陆页面
                System.Web.Security.FormsAuthentication.SignOut();
                System.Web.HttpContext.Current.Session.Abandon();
                Response.Redirect(string.Format("~/Login.aspx?action=loginout&Page={0}", Request.Path));
            }
            else
            {
                // 获取Url
                Uri oldUrl = Request.UrlReferrer;
                Uri newUrl = Request.Url;
                
                //}
            }
        }
        #endregion
    }
}
